<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>
<body>
    <ul>
        <li>项目1</li>
        <li>项目2</li>
        <li>项目3</li>
        <li>项目4</li>
        <li>项目5</li>
        <li>项目6</li>
        <li>项目7</li>
        <li>项目8</li>
        <li>项目9</li>
        <li>项目10</li>
    </ul>
</body>
<script src="../lib/jquery.min.js"></script>
<script>
    $(function(){
        // $("ul li:first-child").css("color","red")
        $("ul li:first").css("color","orange")
        $("ul li:last").css("color","orange")
       // $("ul li:last-child").css("color","red")
       // $("ul li:nth-child(5)").css("color","blue")
       $("ul li:eq(5)").css("color","orange")
    //    $("ul li:nth-child(odd)").css("color","gray")
    //    $("ul li:nth-child(even)").css("color","blue")
    $("ul li:even").css("color","blue")
    $("ul li:odd").css("color","green")
    $("ul li:gt(5)").css("background-color","red")
    });
</script>
</html>